<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
  html,body{    /*必须使用此CSS，否则onclick无效*/
    width:100%;
    height:100%;
  }
  </style>
  <script>
    function dian(e){
        dianX = e.clientX;      //获取在浏览器显示区域的坐标位置
        dianY = e.clientY;
        alert("x:"+dianX+",y:"+dianY);
    }
  </script>
 </head>
 <body onclick='dian(event)'>
 </body>
</html>
